import java.util.Random;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LEGION
 * Date: 2023-04-19
 * Time: 19:30
 */
public class J230419 {
    public static void main(String[] args) {
        int a = 20;
        int b = 10;
        int c = a % b;
        while (c != 0) {
            a = b;
            b = c;
            c = a % b;
        }
        System.out.println(b);
    }
    public static void main7(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        for (int i = 30; i >= 0 ; i -= 2) {
            System.out.print(((n >> i)&1)+ " ");
        }
        System.out.println();
        for (int i = 31; i >= 0 ; i -= 2) {
            System.out.print(((n >> i)&1)+ " ");
        }
    }
    public static void main6(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = 3;
        while (a != 0){
            String str = scanner.nextLine();
            if(str.equals("159357")) {
                System.out.println("成功!");
                break;
            }else {
                a--;
                System.out.println("还有" + a + "次机会");
            }
        }

    }
    public static void main5(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        while (n != 0){
            System.out.println(n%10);
            n /= 10;
        }
    }
    public static void main4(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int n = scanner.nextInt();
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    if (i == j || i + j == n - 1) {
                        System.out.print("*");
                    } else {
                        System.out.print(" ");
                    }
                }
                System.out.print("\n");
            }
        }
    }
    public static void main3(String[] args) {
        Random random = new Random();
        Scanner sc = new Scanner(System.in);
        int toGuess = random.nextInt(100);
        while (true) {
            System.out.println("请输入要输入的数字: (1-100)");
            int num = sc.nextInt();
            if (num < toGuess) {
                System.out.println("低了");
            } else if (num > toGuess) {
                System.out.println("高了");
            } else {
                System.out.println("猜对了");
                break;
            }

        }
    }
    public static void main2(String[] args) {
        int j = 0;
        double num = 0;
        for (double i = 1; i <= 100 ; i++) {
            num += Math.pow(-1,i+1)*(1/i);
        }
        System.out.println(num);
    }
    public static void main1(String[] args) {
        int j = 0;
        for (int i = 0; i <=100 ; i++) {
            if(i%10==9){
                j++;
            }
            if(i/10 == 9){
                j++;
            }
        }
        System.out.println(j);
    }
}
